home *** CD-ROM | disk | FTP | other *** search
- =======================================================================
- Introduction
-
- This directory contains example programs designed to help you learn some
- DV-Tools concepts and coding techniques. You should use the document
- "DV-Tools Getting Started" to introduce you to DV-Tools routines, concepts
- and programming techniques. This document highlights coding basics and some
- of the most common features of DV-Tools programs. The document uses six of
- the example programs to introduce you to DV-Tools routines and concepts:
- playback.c, win_evnt.c, dp_cre.c, dvtools.c, bf_rebnd.c, and inputs.c.
-
- Users with Small Screens: The examples are designed to run on a large screen
- (1024x768). If you have a smaller or low-resolution screen the examples will
- still run, but they may not display correctly. Windows may be positioned so
- that they are partly off the screen. In examples with graphs, you may get a
- "Viewport too small" error resulting in the graph not being drawn.
-
- Users with 16-Color Displays: The example views are designed to run on a
- 256-color display. On a 16-color display, some color combinations may look
- strange or lack enough contrast to distinguish objects. To improve the
- appearance, you can load the example view in DV-Draw and edit colors on
- your machine.
- =======================================================================
-
- To use the examples, first open an MS-DOS command prompt, and go to the
- examples directory:
-
- cd <dataviews>\dvtools\examples\programs
-
- To make a single example, type:
-
- nmake <example_name>.exe
-
- For example:
-
- nmake axis.exe
-
- To make all the examples with a single operation, type:
-
- nmake
-
- To run an example:
- Open the File Manager.
- Go to the <dataviews>\dvtools\examples\programs directory.
- Select the name of the example that you want to run.
-
- You can also run the example from the command prompt.
- To run an example, type:
-
- <example_name> -options
-
- All of the examples use a NULL path in their call to TInit(), so be sure
- that the DVPATH configuration variable is set.
-
- All programs are set up to run without any arguments. If you don't specify a
- device with DVDEVICE you must specify one on the command line. Some examples
- take optional arguments. Look at the code and study the example.
-
- To exit an example, type <q|Q>, press the right mouse button, or select a
- "QUIT" object.
-
- A good learning path is to run the examples in a debugger so you can see
- what each function call accomplishes. Because some graphics are buffered,
- you may want to call GRflush as you step through the examples.
-
- =======================================================================
-
- axis.c Exercises the VUax* routines. This example is useful to programmers
- who are writing their own display formatters and drawing their own axes.
-
- buf_rebind.c Shows how to attach your program's data to your dynamic
- objects, by-passing the DataViews data source facility. The routine
- TvdPutBuffer is used to "rebind" your data.
-
- buf_stuff.c Shows how to attach your application's data to the DataViews
- data source variables. Instead of updating the data source with DataViews
- routines, "stuff" your own data into the data source variable's buffer.
- TdsvGetBuffer is the routine used to accomplish this.
-
- dp_create.c Shows how to create drawports (DataViews viewing windows) using
- a "layout" file created in DV-Draw. The layout file contain rectangles that
- define where each drawport should appear. Uses TdrGetNamedObject, VOobBox,
- TdpCreateStretch.
-
- dp_manip.c Shows how to ZOOM, PAN and REDRAW drawports using functions such
- as TdpCreateStretch(), TdpZoom(), TdpPan(), TdpZoomTo(), TdpRedraw(), and
- TscReset(). A menu and a scrollbar are used to control the display.
-
- dragging.c Shows how to "drag" an object over other objects by using the XOR
- drawing mode. GRset and VOloState are used.
-
- dvtoolsdemo.c Shows how to manage views created in DV-Draw, allowing the
- user to switch from view to view. This is done by getting the name of the
- "picked" object and finding a view with the same name. This program "loads"
- the view every time it's displayed.
-
- dynamic_sd.c Demonstrates the mapping of dynamic subdrawing datasource
- variables to the main data source list within DV-Tools. It also shows how to
- manage and collect the list of data source variables from the main view and
- subdrawing views using linked lists.
-
- dynamics.c Shows how to assign different types of dynamics to objects. This
- example creates a simple dial rotating inside a circle. VOdyCreate,
- VOdySetEraseMethod, VOdyAttachData, VOobDySet, VOttCreate, VOttAddThresh,
- and VOvdCreate are used. A dynamic text object is also shown.
-
- event_post.c Shows how to use VUerBoundaryEventPost to post different kinds
- of event requests. Choose a posting method from the menu then try to select
- the polygon objects.
-
- forms.c Shows how to program text entry in a "form," that is, how to use a
- DV-Draw view with several text input objects but focus keyboard entry go to
- a given input object regardless of the position of the cursor.
-
- graph_disp.c Shows how to use separate drawports for each graph in order to
- continually update overlapping graphs. Demonstrates zooming, partial
- redrawing, and changing variable range on graphs.
-
- graph_query.c Demonstrates how to use VPdgdfquery() to retrieve information
- about a graph. The routine is used to get the the selected data slot and the
- data value of the variable displayed at the user selected point. A line is
- drawn at the selected data slot while the selected data value is displayed
- in a digits graph.
-
- graph_scroll.c Shows how to scroll through data for a graph and display
- different data sets in the graph. The example uses rebinding, indirect
- access mode and a tick labeling function. It also demonstrates the use of
- VUerWinEventPost for handling window events.
-
- image_colors.c Shows ways of creating color tables based on the colors of
- images or icons being displayed. VOpmBestColors, VUctBestColors, and
- VUctTransform are the most important functions used.
-
- in_create.c Shows how to create input objects programmatically. Several
- input objects are created and embedded into a Combiner. VOinCreate,
- VOinTechnique, VOinPutList, VOinPutListValues are some of the routines used.
-
- in_multiplex.c Shows how to create a multiplexor input object
- programmatically.
-
- inputs.c Shows how to set up Service Result events for input objects
- created in DV-Draw. The example performs different actions depending on the
- menu item selected.
-
- move_object.c Demonstrates how to move objects around the screen using
- VOobPtGet() and VOptMove().
-
- ob_box.c Demonstrates how the function VOobBox() works.
-
- palette.c Shows how to customize your own color table for use in
- applications. The color table can be saved to a file and used as the primary
- color table.
-
- pixmaps.c Demonstrates the use of pixmaps, images and icons. Uses the VOpm,
- VOim, and VOic routines.
-
- pixreps.c Demonstrates the use of pixreps and pixscans.
-
- playback.c Plays back a view created in DV-Draw. This is the simplest DV-
- Tools example. It shows the core of DV-Tools programming.
-
- popup.c Shows how to bring up "popup" inputs from views created in DV-Draw.
- The popup controls the color and patterns of a rectangle.
-
- proto_multi.c Shows how to invoke two prototypes from DV-tools. The Tproto routines are used to run each prototype in its own window.
-
- rule_create.c Shows how to add and modify rules associated with objects and
- the view. VOruCreate, VUruGetInfo, VOruSetInfo, VOruAddToOb, and
- VOruGetFromOb are used.
-
- slot_create.c Shows how to attach data to objects using the SLOT mechanism.
- VOskDeclare, VOobSetSlot, and VOobGetSlot are some of the routines used.
-
- symload.c Shows how to manage views the way dvtools.c does. This program
- differs from dvtools.c in that it "pre-loads" all the possible views, using
- the symbol table routines (VT) to manage the view names. This allows
- switching from view to view without waiting for the view to be "loaded."
-
- text_editor.c Demonstrates how to use the text editor input object. This is
- a multi-line text entry input object.
-
- textarray.c Exercises the VUta* routines which are used to manipulate a
- window into a 2-D array of text. This lets you provide basic terminal
- emulation.
-
- view_create.c Demonstrates the basics of creating the entire structure of a
- view within a DV-Tools program. Nothing is pre-created or pre-loaded from
- DV-Draw. Graphs, dynamic color objects, and dynamic subdrawing objects are
- created.
-
- view_merge.c Shows how to merge two previously saved views into one larger
- view. Uses TviMergeAddDataSources and TviMergeDrawing.
-
- win_event.c Exercises event gathering in a single window using
- VOscWinEventPoll(). Events such as, RESIZE, QUIT, BUTTON_DOWN, EXPOSE are
- examined. Uses VOscWinEventMask(), VOloWinEventGet(), VOloType and GRset().
-
- win_multi.c Exercises event gathering in multiple windows using
- VOloWinEventPoll().
-